public class SellTicketTest2
{
    public static void main(String[] args)
    {
        SellTickets2 s1 = new SellTickets2(200);
        SellTickets2 s2 = new SellTickets2(200);
        SellTickets2 s3 = new SellTickets2(200);

        s1.start();
        s2.start();
        s3.start();
    }
}

class SellTickets2 extends Thread
{
    private int numOfTickets;

    public SellTickets2(int numOfTickets)
    {
        this.numOfTickets = numOfTickets;
    }

    @Override
    public void run()
    {
        int count = 0;
        while (count <= this.numOfTickets)
        {
            System.out.println(Thread.currentThread().getName() + " is selling tickets "  + count);
            count++;
        }
    }
}